home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 176-200 / disk_197 / stevie / term.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  6KB  |  145 lines

  1. /*
  2.  * STEVIE - Simply Try this Editor for VI Enthusiasts
  3.  *
  4.  * Code Contributions By : Tim Thompson           twitch!tjt
  5.  *                         Tony Andrews           onecom!wldrdg!tony 
  6.  *                         G. R. (Fred) Walter    watmath!watcgl!grwalter 
  7.  */
  8.  
  9. /*
  10.  * This file contains the machine dependent escape sequences that the editor
  11.  * needs to perform various operations. Some of the sequences here are
  12.  * optional. Anything not available should be indicated by a null string. In
  13.  * the case of insert/delete line sequences, the editor checks the capability
  14.  * and works around the deficiency, if necessary. 
  15.  *
  16.  * Currently, insert/delete line sequences are used for screen scrolling. There
  17.  * are lots of terminals that have 'index' and 'reverse index' capabilities,
  18.  * but no line insert/delete. For this reason, the editor routines s_ins()
  19.  * and s_del() should be modified to use 'index' sequences when the line to
  20.  * be inserted or deleted at line zero. 
  21.  */
  22.  
  23. /*
  24.  * The macro names here correspond (more or less) to the actual ANSI names 
  25.  */
  26.  
  27. #ifdef    ATARI
  28. #define    T_EL    "\033l"        /* erase the entire current line */
  29. #define    T_IL    "\033L"        /* insert one line */
  30. #define    T_IL_B    ""
  31. #define    T_DL    "\033M"        /* delete one line */
  32. #define    T_DL_B    ""
  33. #define    T_SC    "\033j"        /* save the cursor position */
  34. #define    T_ED    "\033E"        /* erase display (may optionally home cursor) */
  35. #define    T_RC    "\033k"        /* restore the cursor position */
  36. #define    T_CI    "\033f"        /* invisible cursor (very optional) */
  37. #define    T_CV    "\033e"        /* visible cursor (very optional) */
  38. #define T_TP    ""        /* plain text */
  39. #define T_TI    ""        /* inverse-video text */
  40. #endif
  41.  
  42. #ifdef    UNIX
  43. /*
  44.  * The UNIX sequences are hard-wired for ansi-like terminals. I should really
  45.  * use termcap/terminfo, but the UNIX port was done for profiling, not for
  46.  * actual use, so it wasn't worth the effort. 
  47.  */
  48. #define    T_EL    "\033[2K"    /* erase the entire current line */
  49. #define    T_IL    "\033[L"    /* insert one line */
  50. #define    T_IL_B    ""
  51. #define    T_DL    "\033[M"    /* delete one line */
  52. #define    T_DL_B    ""
  53. #define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  54. #define    T_SC    "\0337"        /* save the cursor position */
  55. #define    T_RC    "\0338"        /* restore the cursor position */
  56. #define    T_CI    ""        /* invisible cursor (very optional) */
  57. #define    T_CV    ""        /* visible cursor (very optional) */
  58. #define T_TP    ""        /* plain text */
  59. #define T_TI    ""        /* inverse-video text */
  60. #endif
  61.  
  62. #ifdef    BSD
  63. /* The BSD 4.3 sequences are hard-wired for ansi-like terminals. */
  64. #define    T_EL    "\033[2K"    /* erase the entire current line */
  65. #define    T_IL    "\033[L"    /* insert line */
  66. #define    T_IL_B    ""
  67. #define    T_DL    "\033[M"    /* delete line */
  68. #define    T_DL_B    ""
  69. #define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  70. #define    T_SC    ""        /* save the cursor position */
  71. #define    T_RC    ""        /* restore the cursor position */
  72. #define    T_CI    ""        /* invisible cursor (very optional) */
  73. #define    T_CV    ""        /* visible cursor (very optional) */
  74. #define T_TP    ""        /* plain text */
  75. #define T_TI    ""        /* inverse-video text */
  76. #endif
  77.  
  78. #ifdef    OS2
  79. /*
  80.  * The OS/2 ansi console driver is pretty deficient. No insert or delete line
  81.  * sequences. The erase line sequence only erases from the cursor to the end
  82.  * of the line. For our purposes that works out okay, since the only time
  83.  * T_EL is used is when the cursor is in column 0.
  84.  *
  85.  * The insert/delete line sequences marked here are actually implemented in
  86.  * the file os2.c using direct OS/2 system calls. This makes the capability
  87.  * available for the rest of the editor via appropriate escape sequences
  88.  * passed to outstr().
  89.  */
  90. #define    T_EL    "\033[K"    /* erase the entire current line */
  91. #define    T_IL    "\033[L"    /* insert one line - fake (see os2.c) */
  92. #define    T_IL_B    ""
  93. #define    T_DL    "\033[M"    /* delete one line - fake (see os2.c) */
  94. #define    T_DL_B    ""
  95. #define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  96. #define    T_SC    "\033[s"    /* save the cursor position */
  97. #define    T_RC    "\033[u"    /* restore the cursor position */
  98. #define    T_CI    ""        /* invisible cursor (very optional) */
  99. #define    T_CV    ""        /* visible cursor (very optional) */
  100. #define T_TP    ""        /* plain text */
  101. #define T_TI    ""        /* inverse-video text */
  102. #endif
  103.  
  104. #ifdef AMIGA
  105. /*
  106.  * The erase line sequence only erases from the cursor to the end of the
  107.  * line. For our purposes that works out okay, since the only time T_EL is
  108.  * used is when the cursor is in column 0. 
  109.  */
  110. #define    T_EL    "\033[K"    /* erase the entire current line */
  111. #define    T_IL    "\033["        /* insert line */
  112. #define    T_IL_B    "L"
  113. #define    T_DL    "\033["        /* delete line */
  114. #define    T_DL_B    "M"
  115. #define    T_ED    "\014"        /* erase display (may optionally home cursor) */
  116. #define    T_RC    ""        /* restore the cursor position */
  117. #define    T_SC    ""        /* save the cursor position */
  118. #define    T_CI    "\033[0 p"    /* invisible cursor (very optional) */
  119. #define    T_CV    "\033[1 p"    /* visible cursor (very optional) */
  120. #define T_TP    "\033[0m"    /* plain text */
  121. #define T_TI    "\033[7m"    /* inverse-video text */
  122. #endif
  123.  
  124. #ifdef    DOS
  125. /*
  126.  * DOS sequences
  127.  *
  128.  * Some of the following sequences require the use of the "nansi.sys"
  129.  * console driver. The standard "ansi.sys" driver doesn't support
  130.  * sequences for insert/delete line.
  131.  */
  132. #define    T_EL    "\033[K"    /* erase the entire current line */
  133. #define    T_IL    "\033[L"    /* insert line (requires nansi.sys driver) */
  134. #define    T_IL_B    ""
  135. #define    T_DL    "\033[M"    /* delete line (requires nansi.sys driver) */
  136. #define    T_DL_B    ""
  137. #define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  138. #define    T_SC    "\033[s"    /* save the cursor position */
  139. #define    T_RC    "\033[u"    /* restore the cursor position */
  140. #define    T_CI    ""        /* invisible cursor (very optional) */
  141. #define    T_CV    ""        /* visible cursor (very optional) */
  142. #define T_TP    ""        /* plain text */
  143. #define T_TI    ""        /* inverse-video text */
  144. #endif
  145.